<?php
	require_once('includes/bootstrap.php');
?>

<html>
	<head>
		<?php include_once('includes/head.php'); ?>
	</head>

	<body>

		<?php include_once('includes/header.php'); ?>
		
		<script type="text/javascript">
		
			<?php if (!empty($_SESSION['just_added'])) { ?>
				noty({text: "Merci d'avoir ajouté '<?= addslashes($_SESSION['just_added']['name']) ?>' à votre commande.", layout: 'topCenter', type: 'success'});
			<?php unset($_SESSION['just_added']); ?>
			<?php } ?>
		
			<?php if (!empty($_SESSION['notification'])) { ?>
				noty({text: "<?= addslashes($_SESSION['notification']) ?>", layout: 'topCenter', type: 'success'});
			<?php unset($_SESSION['notification']); ?>
			<?php } ?>
		
		</script>

		<img src="PIETONNE2.jpg" usemap="#mapmenu" />

		<a href="https://maps.google.fr/maps?q=9+Rue+du+Commandant+Raffali,+Nice&hl=fr&ie=UTF8&ll=43.696331,7.264688&spn=0.011511,0.024612&sll=43.698146,7.26398&sspn=0.011511,0.024612&hnear=9+Rue+du+Commandant+Raffali,+06000+Nice,+Alpes-Maritimes,+Provence-Alpes-C%C3%B4te+d'Azur&t=m&z=16" target="_blank">
			<img src="pietonne_bottom.jpg" title="Voir l'emplacement sur la carte" />
		</a>
		
		<map name="mapmenu">
			<area shape="rect" coords="53,80,280,227" href="javascript:confirmCommande('PASTILLA_POULET');" title="Pastilla au Poulet" />
			<area shape="rect" coords="309,85,532,227" href="javascript:confirmCommande('TAJINE_AGNEAU');" title="Tajine d'Agneau" />
			<area shape="rect" coords="54,236,275,376" href="javascript:confirmCommande('TAJINE_POULET');" title="Tajine de Poulet" />
			<area shape="rect" coords="309,236,532,376" href="javascript:confirmCommande('COUSCOUS');" title="Couscous Marocain" />

			<area shape="rect" coords="19,402,509,806" href="javascript:confirmCommande('SALADES');" title="Salades" />

			<area shape="rect" coords="593,94,884,251" href="javascript:confirmCommande('BROCHETTE_KEFTA');" title="Brochette de Kefta" />
			<area shape="rect" coords="593,273,884,394" href="javascript:confirmCommande('ASSIETTE_BOUCHER');" title="Assiette du Boucher - Grillade Mix" />
			<area shape="rect" coords="947,18,1189,220" href="javascript:confirmCommande('BROCHETTE_POULET');" title="Brochette de Poulet" />
			<area shape="rect" coords="885,251,1189,396" href="javascript:confirmCommande('PILONS_POULET');" title="Pilons de Poulet" />

			<area shape="rect" coords="527,502,959,598" href="javascript:confirmCommande('POULET_MARINE');" title="Poulet Mariné" />
			<area shape="rect" coords="527,599,959,680" href="javascript:confirmCommande('KEFTA');" title="Kefta" />
			<area shape="rect" coords="975,405,1189,538" href="javascript:confirmCommande('PANINI');" title="Panini" />
			<area shape="rect" coords="975,549,1189,654" href="javascript:confirmCommande('NICOIS');" title="Niçois" />
			<area shape="rect" coords="750,680,1189,709" href="javascript:confirmCommande('SUPPLEMENT');" title="Supplément menu" />

			<area shape="rect" coords="528,715,723,805" href="javascript:confirmCommande('PIZZA');" title="Pizza" />
			<area shape="rect" coords="724,715,930,805" href="javascript:confirmCommande('DESSERT');" title="Dessert" />
			<area shape="rect" coords="931,715,1075,746" href="javascript:confirmCommande('BOISSON');" title="Boisson 33cl" />
			<area shape="rect" coords="931,747,1075,805" href="javascript:confirmCommande('CAFE');" title="Café" />
			<area shape="rect" coords="1076,715,1189,805" href="javascript:confirmCommande('THE');" title="Thé" />
		</map>
		
		<script type="text/javascript">
		
			var items = {};
			
			<?php
				$req = mysql_query('SELECT * FROM items ORDER BY name ASC');
				
				while ($row = mysql_fetch_assoc($req))
				{
					echo 'items.' . $row['code'] . ' = "' . $row['name'] . '";';
				}
			?>
		
			function confirmCommande(code)
			{
				if (!items[code])
					return;
			
				if (!confirm('Voulez vous ajouter cet élément à votre commande : ' + items[code] + ' ?'))
					return;
				
				location.href = "add_item.php?code=" + code;
			}
		</script>

	</body>

</html>
